import request from '@/utils/request'

// 登录方法
export function login(username: string, password: string, code?: any, uuid?: any): any {
  const data = {
    username,
    password,
    code,
    uuid
  }
  return request({
    url: '/core/api/login/',
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/core/api/login/current-user',
    method: 'get'
  })
}

// 修改密码
export function changePassword(data: { newPassword: string, oldPassword: string }) {
  return request({
    url: '/core/api/login/change-password',
    method: 'post',
    data: data
  })
}
